package com.itheima.controller;
import com.changgou.entity.Result;
import com.changgou.entity.StatusCode;
import com.itheima.pojo.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/user")
public class Usercontroller {
    @Autowired
    private UserService userService;
    @GetMapping("/findAdd")
    private Result findAdd(){
        List <User> add = userService.findAdd ();
        return new Result (true, StatusCode.OK,"chengg",add);
    }

}
